import {Component} from '@angular/core';
import {NavController} from 'ionic-angular';
// import {NavParams} from 'ionic-angular';
import {ViewController} from 'ionic-angular';
import {Platform} from 'ionic-angular';


//  http请求
import {Http} from '@angular/http';
import 'rxjs/add/operator/toPromise';
import 'rxjs/add/operator/timeout';
//接受服务传递过来的当前经销商产品信息
import {services} from "../../../../../providers/service";
@Component({
    selector: 'page-product2',
    templateUrl: 'product2.html'
})
export class productPage2 {

    product: any;
    productInner = document.getElementById("product_content");

    constructor(public navCtrl: NavController, public http: Http, public platform: Platform, public viewCtrl: ViewController, public services: services) {
        //接受来自服务的产品信息情况
        this.product = this.services.productList02;
        console.log(this.product);
    }

//返回产品信息页面
    dismiss() {
        this.viewCtrl.dismiss();
    }

    check(datapr) {
        this.productInner.innerHTML = datapr.name;
        console.info(this.productInner.innerHTML);

        this.services.productId2 = datapr.id;
        console.info(this.services.productId2);
        this.viewCtrl.dismiss();

    }

}